﻿<Window x:Class="ToDoListReminder.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:vm="clr-namespace:ToDoListReminder.ViewModel"
    Title="Todo List Reminder" Height="337" Width="477" WindowStartupLocation="CenterScreen" 
		Icon="/ToDoListReminder;component/ToDoListReminder.ico" Closing="Window_Closing">

	<Window.Resources>
		<vm:CommandProxy x:Key="CommandConfig" Command="{Binding CommandConfig}"/>
		<vm:CommandProxy x:Key="CommandRefresh" Command="{Binding CommandRefresh}"/>

		<vm:CommandProxy x:Key="CommandAbout" Command="{Binding CommandAbout}"/>

		<vm:CommandProxy x:Key="CommandExit" Command="{Binding CommandExit}"/>
	</Window.Resources>

	<Window.InputBindings>
		<KeyBinding Command="{StaticResource CommandExit}" Gesture="CTRL+Q"/>
	</Window.InputBindings>

	<DockPanel>
		<Menu DockPanel.Dock="Top">
			<MenuItem Header="_File">
				<MenuItem Header="_Config" Command="{StaticResource CommandConfig}"/>
				<MenuItem Header="_Refresh" Command="{StaticResource CommandRefresh}"/>
				<Separator/>
				<MenuItem Header="E_xit" Command="{StaticResource CommandExit}" InputGestureText="CTRL+Q"/>
			</MenuItem>
			<MenuItem Header="_Help">
				<MenuItem Header="_About" Command="{StaticResource CommandAbout}"/>
			</MenuItem>
		</Menu>

		<StatusBar DockPanel.Dock="Bottom">
			<StatusBarItem>
				<TextBlock Text="{Binding Path=Status.Projects}"/>
			</StatusBarItem>

			<Separator/>

			<StatusBarItem>
				<TextBlock Text="{Binding Path=Status.Tasks}" />
			</StatusBarItem>
		</StatusBar>

		<ListBox DockPanel.Dock="Top" Name="listBoxTasks" ItemsSource="{Binding Path=Tasks}">
			<ListBox.ItemTemplate>
				<DataTemplate>
					<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
						<TextBlock Text="{Binding Path=ProjectName}" FontWeight="Bold"/>
						<TextBlock Text="{Binding Path=TaskName}"/>
					</StackPanel>
				</DataTemplate>
			</ListBox.ItemTemplate>
		</ListBox>
	</DockPanel>
</Window>
